POV-Ray : Newsgroups : povray.advanced-users : Simple colour_map question : Re: Simple colour_map question Server Time
29 Jul 2024 02:28:57 EDT (-0400)
  Re: Simple colour_map question  
From: Tim Nikias
Date: 15 Feb 2003 14:44:45
Message: <3e4e98ad@news.povray.org>
Just write yourself a macro which interpolates the
indices and colors according to the indices.
You might want to do this using two arrays, one filled
with the colors, the other with the index-values.
Then you just write a macro which runs off with a given
index, searches the two closest (above and below the
given one), and interpolates appropriately using the colors
given by the other array.
This only works with simple linear colormaps, poly_wave
etc would have to undergo postprocessing on the index
values in the array (or the given one) to handle the change
in colorshifts...

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde

> Suppose I declare a colour_map. Is there a way to read a colour out of the
> map? In other words, is there a way I can feed in a nindex value and find
> the corresponding colour?
>
> The docs say I can fetch the colour of a point out of a texture, but what
> I'm asking for is one step simpler than that... Any ideas folks?
>
> Andrew.
>
> PS. Yes, I *know* it's possible to do the linear interpolation manually, but
> it's a pain to keep typing this stuff...
>
>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.